
<template>
  <div id="nav">
    <!-- <router-link to="/">Home</router-link> | -->
    <!-- <router-link to="/about">About</router-link>| -->
    <router-link to="/TokenContent">广点通token管理</router-link>
    |
    <router-link to="/checkUrl">检查网络</router-link>
    <template v-if="!isLogin"
      >|
      <router-link to="/login">登录</router-link>
    </template>
  </div>
  <router-view v-slot="{ Component }">
    <component :is="Component" />
  </router-view>
</template>

<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Aria l, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
<script>
import { defineComponent, ref, watch, computed } from "vue";
import store from "@/store";
import { message } from "ant-design-vue/es";
export default defineComponent({
  setup() {
    // const { state } = import store from "@/store";();
    console.log(store.state.isLogin);
    const isLogin = ref(false);

    const permissions = computed(() => store.state.isLogin);
    watch(permissions, () => {
      isLogin.value = permissions;
      console.log(permissions);
    });
    return {
      isLogin,
    };
  },
});
</script>

